<div class="wide form">

	<?php
	$form = $this->beginWidget('CActiveForm',
		array(
		'action'=>Yii::app()->createUrl($this->route),
		'method'=>'get',
		));
	?>

	<div class="row">
		<?php echo $form->label($model, 'id'); ?>
		<?php
		echo $form->textField($model, 'id');
		?>
	</div>

	<div class="row">
		<?php echo $form->label($model, 'name');
		?>
		<?php
		echo $form->textField($model, 'name', array('size'=>60, 'maxlength'=>255));
		?>
	</div>

	<div class="row">
		<?php echo $form->label($model, 'code');
		?>
		<?php
		echo $form->textField($model, 'code', array('size'=>60, 'maxlength'=>255));
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'gender');
		$genders = Yii::app()->db->createCommand()
			->selectDistinct('gender')
			->from($model->tableName())
			->order('gender')
			->queryColumn();
		$options = array(
			'model'=>$model,
			'attribute'=>'gender',
			'source'=>$genders,
			'htmlOptions'=>array(
				'style'=>'height:20px;',
				'maxlength'=>8,
			),
		);
		$this->widget('zii.widgets.jui.CJuiAutoComplete', $options);
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'matrimony');
		$matrimonies = Yii::app()->db->createCommand()
			->selectDistinct('matrimony')
			->from($model->tableName())
			->order('matrimony')
			->queryColumn();
		$options = array(
			'model'=>$model,
			'attribute'=>'matrimony',
			'source'=>$matrimonies,
			'htmlOptions'=>array(
				'style'=>'height:20px;',
				'maxlength'=>16,
			),
		);
		$this->widget('zii.widgets.jui.CJuiAutoComplete', $options);
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'birthDate');
		$options = array(
			'model'=>$model,
			'attribute'=>'birthDate',
			'options'=>array(
				'dateFormat'=>'yy-mm-dd',
				'changeMonth'=>true,
				'changeYear'=>true,
			),
			'htmlOptions'=>array(
				'style'=>'height:20px;'
			),
		);
		$this->widget('zii.widgets.jui.CJuiDatePicker', $options);
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'employmentStatus');
		?>
		<?php
		echo $form->textField($model, 'employmentStatus',
			array('size'=>60, 'maxlength'=>255));
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'employmentDate');
		$options = array(
			'model'=>$model,
			'attribute'=>'employmentDate',
			'options'=>array(
				'dateFormat'=>'yy-mm-dd',
				'changeMonth'=>true,
				'changeYear'=>true,
			),
			'htmlOptions'=>array(
				'style'=>'height:20px;'
			),
		);
		$this->widget('zii.widgets.jui.CJuiDatePicker', $options);
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'expiredDate');
		$options = array(
			'model'=>$model,
			'attribute'=>'expiredDate',
			'options'=>array(
				'dateFormat'=>'yy-mm-dd',
				'changeMonth'=>true,
				'changeYear'=>true,
			),
			'htmlOptions'=>array(
				'style'=>'height:20px;'
			),
		);
		$this->widget('zii.widgets.jui.CJuiDatePicker', $options);
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'unemploymentDate');
		$options = array(
			'model'=>$model,
			'attribute'=>'unemploymentDate',
			'options'=>array(
				'dateFormat'=>'yy-mm-dd',
				'changeMonth'=>true,
				'changeYear'=>true,
			),
			'htmlOptions'=>array(
				'style'=>'height:20px;'
			),
		);
		$this->widget('zii.widgets.jui.CJuiDatePicker', $options);
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'position');
		$positions = Yii::app()->db->createCommand()
			->selectDistinct('position')
			->from($model->tableName())
			->order('position')
			->queryColumn();
		$options = array(
			'model'=>$model,
			'attribute'=>'position',
			'source'=>$positions,
			'htmlOptions'=>array(
				'style'=>'height:20px;',
				'maxlength'=>32,
			),
		);
		$this->widget('zii.widgets.jui.CJuiAutoComplete', $options);
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'division');
		$divisions = Yii::app()->db->createCommand()
			->selectDistinct('division')
			->from($model->tableName())
			->order('division')
			->queryColumn();
		$options = array(
			'model'=>$model,
			'attribute'=>'division',
			'source'=>$divisions,
			'htmlOptions'=>array(
				'style'=>'height:20px;',
				'maxlength'=>32,
			),
		);
		$this->widget('zii.widgets.jui.CJuiAutoComplete', $options);
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'group');
		$groups = Yii::app()->db->createCommand()
			->selectDistinct('group')
			->from($model->tableName())
			->order('group')
			->queryColumn();
		$options = array(
			'model'=>$model,
			'attribute'=>'group',
			'source'=>$groups,
			'htmlOptions'=>array(
				'style'=>'height:20px;',
				'maxlength'=>32,
			),
		);
		$this->widget('zii.widgets.jui.CJuiAutoComplete', $options);
		?>
	</div>

	<div class="row">
		<?php
		echo $form->label($model, 'supervisorId');
		$models = $model->findAll();
		$data = CHtml::listData($models, 'id', 'name');
		$htmlOptions = array('empty'=>'');
		echo $form->dropDownList($model, 'supervisorId', $data, $htmlOptions);
		?>
	</div>

	<div class="row">
		<?php echo $form->label($model, 'address'); ?>
		<?php
		echo $form->textArea($model, 'address', array('rows'=>6, 'cols'=>50));
		?>
	</div>

	<div class="row">
		<?php echo $form->label($model, 'email');
		?>
		<?php
		echo $form->textField($model, 'email', array('size'=>60, 'maxlength'=>255));
		?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton('Search'); ?>
	</div>

	<?php $this->endWidget(); ?>

</div><!-- search-form -->